<template>
  <div>
    <ul class="pro-ul">
      <li class="pro-li border-right">
        <span class="iconfont">&#xe601;</span>定位失败
      </li>
      <li class="pro-li pro-li-spec">
        <a href>
          <span class="iconfont">&#xe61c;</span>必游榜单
        </a>
      </li>
    </ul>

    <div class="hot-content">
      <div class="hot-title">
        <img
          class="hot-img"
          src="http://img1.qunarzz.com/piao/fusion/1711/16/bfbb9874e8f11402.png"
          alt
        >
        <span class="title-text">本周热门榜单</span>
        <a href class="title-more">
          全部榜单
          <span class="iconfont">&#xe62a;</span>
        </a>
      </div>
      <div class="hot-sale-list">
        <swiper :options="swiperOption">
          <swiper-slide v-for=" (item ,index) in hotGoods" :key="index">
            <div class="hot-sale-item">
              <router-link :to="'/detail/'+item.goodsId">
                <div class="topone">
                  <img class="top-img" :src="item.hotimg" alt>
                </div>
                <img :src="item.image" width="80%">
                <div class="item-name">{{item.name}}</div>
                <div class="item-price-div">
                  <span class="item-price">￥{{item.price}}</span>起
                </div>
              </router-link>
            </div>
          </swiper-slide>
          <div class="swiper-scrollbar" slot="scrollbar"></div>
        </swiper>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  name: "HomeHot",
  props: { hotGoods: Array },
  data() {
    return {
      swiperOption: {
        slidesPerView: 3
      }
    };
  }
};
</script>

<style lang="stylus" scoped>
@import '~styles/mixins.styl';

.pro-ul {
  width: 100%;
  background-color: #fff;
  height: 0;
  padding-bottom: 12%;
  border-top: 1px solid #e0e0e0;
}

.pro-li {
  height: 0.98rem;
  float: left;
  width: 49%;
  font-size: 0.28rem;
  color: #212121;
  line-height: 0.98rem;
  text-align: center;
}

.hot-content {
  width: 100%;
  background-color: #ffffff;
  margin-top: 0.2rem;
}

.hot-title {
  position: relative;
  padding: 0.24rem 0.2rem 0.2rem;
  font-size: 20px;
  height: 0.6rem;
  line-height: 0.6rem;
}

.hot-img {
  width: 0.4rem;
  height: 0.4rem;
  margin-left: 0.2rem;
}

.title-text {
  display: inline-block;
  margin-left: 0.08rem;
  height: 0.44rem;
  color: #212121;
  font-size: 0.32rem;
  line-height: 0.44rem;
}

.title-more {
  position: absolute;
  top: 0.36rem;
  right: 0.42rem;
  color: #616161;
  font-size: 0.3rem;
  line-height: 0.34rem;
}

.topone {
  position: absolute;
  z-index: 999;
}

.top-img {
  height: 0.5rem;
}

.hot-sale-list {
  position: relative;
  padding: 0 0.2rem;
}

.hot-sale-item {
  display: inline-block;
  padding: 0.06rem 0 0.2rem;
  margin-left: 0.2rem;
}

.item-name {
  width: 2.2rem;
  margin-top: 0.12rem;
  color: #212121;
  font-size: 0.24rem;
  line-height: 0.32rem;
  text-align: center;
  ellipsis();
}

.item-price-div {
  width: 2.2rem;
  margin-top: 0.12rem;
  color: #212121;
  font-size: 0.24rem;
  line-height: 0.32rem;
  text-align: center;
  ellipsis();
}

.item-price {
  color: #ff8300;
}
</style>